<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div class="test" data-address="wh" data-age="18"></div>

  <script>
    var div  = document.querySelector('div')

    console.dir( div.getAttribute('data-address') )  // 获取属性

    div.setAttribute('data-address', 'sjz')  // 设置属性

    div.removeAttribute('data-age')  // 移除属性

  </script>
</body>
</html>